package com.kwin.demo.server.module.flink.test.listener;

//import com.kwin.demo.server.module.flink.sink.FlinkConsumerListener;
import com.kwin.demo.server.module.flink.test.entity.Student;
import com.kwin.flink.sink.FlinkConsumerListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author kwin
 * @Date 2022/7/25 18:29
 **/
@Slf4j
@Component
public class StudentConsumerListener implements FlinkConsumerListener<Student> {
    @Override
    public String getDBName() {
        return "flinktest";
    }

    @Override
    public String getTable() {
        return "student";
    }

    @Override
    public void insert(Student data) {
        log.info("insert: {}", data);
        System.out.println("insert: " + data);
    }

    @Override
    public void update(Student srcData, Student destData) {
        log.info("update: \nsrc:{}\ndest:{}", srcData, destData);
        System.out.println("update: \nsrc:" + srcData + "\ndest:" + destData);
    }

    @Override
    public void delete(Student data) {
        log.info("delete: {}", data);
        System.out.println("delete:"+data);
    }
}
